package com.framework.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.dao.LogTranInfoDao;
import com.framework.entity.log.LogTranInfo;
import com.framework.page.PageUtils;
import com.framework.service.LogTranInfoService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("logTranInfoService")
public class LogTranInfoServiceImpl extends ServiceImpl<LogTranInfoDao, LogTranInfo> implements LogTranInfoService {


	@Override
	public PageUtils queryAutoLogList(Map<String, Object> params) {
		if("".equals(params.get("createDate"))){
			params.put("createDate",null);
		}
		Integer pageSize = Integer.valueOf(params.get("limit").toString());
		Integer currPage = Integer.valueOf(params.get("page").toString());
		params.put("start",(currPage-1)*pageSize);
		params.put("limit",pageSize);
		List<Map<String, Object>> list = this.baseMapper.queryAutoLogList(params);
        Integer totalCount = this.baseMapper.queryAutoLogCount(params);
		return new PageUtils(list,totalCount,pageSize,currPage);
	}
}
